package com.gs.netty.Quickstart.interceptor.ex;

import com.gs.netty.core.annotation.CommandControllerAdvice;
import com.gs.netty.core.annotation.CommandExceptionHandler;
import com.gs.netty.websocket.remoting.req.Request;


import com.gs.netty.core.handler.method.HandlerMethod;
import com.gs.netty.websocket.remoting.resp.Response;
import lombok.extern.slf4j.Slf4j;

/**

 * @desccription 统一异常处理
 */

@CommandControllerAdvice
@Slf4j
public class ResponseExceptionHandler {

	@CommandExceptionHandler(Exception.class)

	public String methodNotAllowed(){
		return "异常错误";
	}

	@CommandExceptionHandler(ArithmeticException.class)
	public String ArithmeticException(Request request, Response response, Exception e, HandlerMethod handlerMethod){

		return "异常错误";
	}


}